package com.cat.util;

import com.cat.pojo.Student;

import java.sql.Blob;

public class BeanUtil {
    private BeanUtil() {

    }

    public static Student StudentMapper(String stuId, String stuName, String phoneNum, String passwd,
                                        String userType, String portrait, String gender, String major,
                                        String majorClass, String position, String introduction) {
        Student stu = new Student();

        stu.setStudentId(stuId);
        stu.setStudentName(stuName);
        stu.setPhoneNumber(phoneNum);
        stu.setPassword(passwd);
        stu.setUserType(userType == null || "".equalsIgnoreCase(userType) ? "学生" : userType);
        stu.setPortrait(portrait == null || "".equalsIgnoreCase(portrait) ? "无" : portrait);
        stu.setGender(gender == null || "".equalsIgnoreCase(gender) ? "无" : gender);
        stu.setMajor(major == null || "".equalsIgnoreCase(major) ? "无" : major);
        stu.setMajorClass(majorClass == null || "".equalsIgnoreCase(majorClass) ? "无" : majorClass);
        stu.setPosition(position == null || "".equalsIgnoreCase(position) ? "无" : position);
        stu.setIntroduction(introduction == null || "".equalsIgnoreCase(introduction) ? "无" : introduction);
        return stu;
    }

}
